<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>司机车辆认证</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		var validateForm;
		function doSubmit(){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
		  if(validateForm.form()){
			  $("#inputForm").submit();
			  return true;
		  }
	
		  return false;
		}
		$(document).ready(function() {
            $("#realNameRefusalReasonTr").hide();
            $("#carRefusalReasonTr").hide();
            $("#driverRefusalReasonTr").hide();
            <c:if test="${logisCar.realNameStatus eq '2'}">
            $("#realNameRefusalReasonTr").show();
            </c:if>
            <c:if test="${logisCar.carStatus eq '2'}">
            $("#carRefusalReasonTr").show();
            </c:if>
            <c:if test="${logisCar.driverStatus eq '2'}">
              $("#driverRefusalReasonTr").show();
            </c:if>

		    validateForm = $("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			
		});
        //打开对话框(查看)
        function openDialogViewImg(title,url,width,height){
            top.layer.open({
                type: 1,
                title: false,
                offset: ['20px', '20px'],
                shadeClose: true,
                area: ['420px', '360px'], //宽高
                content: '<img src='+url+' width=420px,height=360px>'
            });
        }

        function changeStats(id,value){
            if(value=='2'){
                $("#"+id).show();
            }else{
                $("#"+id).hide();
            }

        }
	</script>
</head>
<body class="hideScroll">
		<form:form id="inputForm" modelAttribute="logisCar" action="${ctx}/logis/logisCar/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>
			<table class="table table-bordered">
				<tbody>
				<tr><td colspan="7" class="active"><label class="pull-left"><b>实名认证</b></label></td></tr>
				<tr><td width="10%"><label class="pull-left">姓名</label></td>
					<td width="15%"><label class="pull-left">手机号</label></td>
					<td ><label class="pull-left">身份证号码</label></td>
					<td width="8%"><label class="pull-left">性别</label></td>
					<td><label class="pull-left">住址</label></td>
					<td width="10%"><label class="pull-left">身份证件</label></td>
					<td width="10%"><label class="pull-left">审核</label></td>
				</tr>
				<tr>
					<td>
						<form:input path="realName" htmlEscape="false"    class="form-control required"/>
					</td>
					<td>
						<form:input path="mobile" htmlEscape="false"    class="form-control required"/>
					</td>
					<td>
						<form:input path="idCardNum" htmlEscape="false"    class="form-control" maxlength="18"/>
					</td>
					<td>
						<form:input path="gender" htmlEscape="false"    class="form-control required"/>
					</td>
					<td>
						<form:input path="address" htmlEscape="false"    class="form-control"/>
					</td>

					<td>
						<c:if test="${not empty logisCar.idcardImg1}">
							<a  onclick="openDialogViewImg('查看图片', '${logisCar.idcardImg1}','800px', '500px')">查看</a>
							<a href="${logisCar.idcardImg1}" download="${logisCar.id}_1">[下载]</a>
						</c:if>

						<c:if test="${not empty logisCar.idcardImg2}">
							<a  onclick="openDialogViewImg('查看图片', '${logisCar.idcardImg2}','800px', '500px')">查看</a>
							<a href="${logisCar.idcardImg2}" download="${logisCar.id}_2">[下载]</a>
						</c:if>

						<c:if test="${empty logisCar.idcardImg1&&empty logisCar.idcardImg2}">
							未上传
						</c:if>
					</td>

					<td>
						<form:select path="realNameStatus" class="form-control required" onchange="changeStats('realNameRefusalReasonTr',this.value)">
							<form:option value="" label=""/>
							<form:options items="${fns:getDictList('logis_audit_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>
				</tr>
				<tr id="realNameRefusalReasonTr">
					<td colspan="7" class="text-danger">
						<form:radiobuttons path="realNameRefusalReason" items="${fns:getDictList('realNameRefusalReason')}" itemLabel="label" itemValue="value" htmlEscape="false" class="i-checks text-danger"/>
					</td>
				</tr>
				</tbody>
			</table>


			<table class="table table-bordered">
				<tbody>
				<tr><td colspan="8" class="active"><label class="pull-left"><b>司机认证</b></label></td></tr>
				<tr><td width="10%"><label class="pull-left">姓名</label></td>
					<td width="12%"><label class="pull-left">准驾车型</label></td>
					<td width="18%"><label class="pull-left">初次领证日期</label></td>
					<td width="15%"><label class="pull-left">有效期起止日期</label></td>
					<td><label class="pull-left">主副驾驶</label></td>
					<td><label class="pull-left">驾驶证</label></td>
					<td><label class="pull-left">司机头像</label></td>
					<td width="10%"><label class="pull-left">审核</label></td>
				</tr>
				<tr>
					<td>
						${logisCar.realName}
					</td>
					<td>
						<form:input path="zjcx" htmlEscape="false"    class="form-control"/>
					</td>
					<td>
						<form:input path="cclzrq" htmlEscape="false"    class="form-control"/>
					</td>
					<td>
								<form:input path="yxqqssj" htmlEscape="false"    class="form-control"/>
								<form:input path="yxqzssj" htmlEscape="false"    class="form-control"/>
					</td>
					<td>
						<c:if test="${not empty logisCar.masterDriver}">
							主驾驶
						</c:if>
						<c:if test="${empty logisCar.masterDriver}">
							副驾驶
						</c:if>

					</td>
					<td>
						<c:if test="${not empty logisCar.jszImg1}">
							<a  onclick="openDialogViewImg('查看图片', '${logisCar.jszImg1}','800px', '500px')">查看</a>
						</c:if>
						<c:if test="${empty logisCar.jszImg1}">
							未上传
						</c:if>
					</td>

					<td>
						<c:if test="${not empty logisCar.headImg}">
							<a  onclick="openDialogViewImg('查看司机头像', '${logisCar.headImg}','800px', '500px')">查看</a>
						</c:if>
						<c:if test="${empty logisCar.headImg}">
							未上传
						</c:if>
					</td>

					<td>
						<form:select path="driverStatus" class="form-control required" onchange="changeStats('driverRefusalReasonTr',this.value)">
							<form:option value="" label=""/>
							<form:options items="${fns:getDictList('logis_audit_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>
				</tr>
				<tr id="driverRefusalReasonTr">
					<td colspan="8" class="text-danger">
						<form:radiobuttons path="driverRefusalReason" items="${fns:getDictList('driverRefusalReason')}" itemLabel="label" itemValue="value" htmlEscape="false" class="i-checks text-danger"/>
					</td>
				</tr>
				</tbody>
			</table>

			<table class="table table-bordered">
				<tbody>
				<tr><td colspan="10" class="active"><label class="pull-left"><b>车辆认证</b></label></td></tr>
				<tr><td width="15%"><label class="pull-left">车牌号</label></td>
					<td width="15%"><label class="pull-left">挂车车牌</label></td>
					<td width="8%"><label class="pull-left">车辆类型</label></td>
					<td width="8%"><label class="pull-left">车身长度</label></td>
					<td width="8%"><label class="pull-left">核定载重吨</label></td>
					<td width="8%"><label class="pull-left">车辆品牌</label></td>
					<td><label class="pull-left">使用性质</label></td>
					<td><label class="pull-left">行驶证</label></td>
					<td><label class="pull-left">挂车行驶证</label></td>
					<td width="10%"><label class="pull-left">审核</label></td>
				</tr>
				<tr>
					<td>
						<form:input path="licensePlate" htmlEscape="false"    class="form-control required"/>
					</td>
					<td>
						<form:input path="trailerLicensePlate" htmlEscape="false"    class="form-control"/>
					</td>
					<td>
						<form:input path="models" htmlEscape="false"    class="form-control"/>
					</td>
					<td>
						<form:input path="carLength" htmlEscape="false"    class="form-control"/>
					</td>
					<td>
						<form:input path="loadweight" htmlEscape="false"    class="form-control"/>
					</td>
					<td>
						<form:input path="brand" htmlEscape="false"    class="form-control"/>
					</td>
					<td>
						货运
					</td>
					<td>
						<c:if test="${not empty logisCar.xszImg1}">
							<a  onclick="openDialogViewImg('查看图片', '${logisCar.jszImg1}','800px', '500px')">查看</a>
						</c:if>
						<c:if test="${empty logisCar.xszImg1}">
							未上传
						</c:if>
						<c:if test="${not empty logisCar.xszImg2}">
							<a  onclick="openDialogViewImg('查看图片', '${logisCar.xszImg2}','800px', '500px')">查看</a>
						</c:if>
						<c:if test="${empty logisCar.xszImg2}">
							未上传
						</c:if>
					</td>
					<td>
						<c:if test="${not empty logisCar.gcXszImg1}">
							<a  onclick="openDialogViewImg('查看图片', '${logisCar.gcXszImg1}','800px', '500px')">查看</a>
						</c:if>
						<c:if test="${empty logisCar.gcXszImg1}">
							未上传
						</c:if>
						<c:if test="${not empty logisCar.gcXszImg2}">
							<a  onclick="openDialogViewImg('查看图片', '${logisCar.gcXszImg2}','800px', '500px')">查看</a>
						</c:if>
						<c:if test="${empty logisCar.gcXszImg2}">
							未上传
						</c:if>
					</td>



					<td>
						<form:select path="carStatus" class="form-control required" onchange="changeStats('carRefusalReasonTr',this.value)">
							<form:option value="" label=""/>
							<form:options items="${fns:getDictList('logis_audit_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>
				</tr>
				<tr id="carRefusalReasonTr">
					<td colspan="10" class="text-danger">
						<form:radiobuttons path="carRefusalReason" items="${fns:getDictList('carRefusalReason')}" itemLabel="label" itemValue="value" htmlEscape="false" class="i-checks text-danger"/>
					</td>
				</tr>
				</tbody>
			</table>
	</form:form>
</body>
</html>